package com.springboot.logback.controller;

import com.springboot.logback.service.UserInfoService;
import com.springboot.logback.utils.ILogger;
import com.springboot.logback.utils.LoggerManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.Map;

/**
 * neu
 * 2019/7/26 16:04
 *
 * @Version : 1.0
 * @Description :
 */
@Controller
@RequestMapping("userInfo")
public class UserInfoController {

    private static ILogger LOG = LoggerManager.getLogger(UserInfoController.class);

    @Autowired
    private UserInfoService userInfoService;

    @ResponseBody
    @RequestMapping("/findUserInfo")
    public Map<String,Object> findUserInfo(Map<String,Object> map){

        int i = 0;
        while(i<100){
            System.out.println("  UserInfoController   findUserInfo ");
            LOG.info("  info    info     UserInfoController     ");
            LOG.debug(" debug     debug   UserInfoController     ");
            LOG.error(" error     error    UserInfoController    ");
            LOG.warn("  warn      warn      UserInfoController  ");
            LOG.trace(" trace       trace     UserInfoController  ");
            i++;
        }
        userInfoService.findUserInfo();
        return map;
    }
}
